﻿package com.zit.presentation.action;

import java.util.ArrayList;
import java.util.List;

import com.zit.entity.Course;
import com.zit.entity.Profession;
import com.zit.entity.Term;
import com.zit.service.CourseService;

/**
 * @author 王冲
 *功能：显示课程
 * date2013-12-4 time上午11:04:10
 */
@SuppressWarnings("serial")
public class ShowCourseAction extends BaseAction {
	private CourseService courseService=new CourseService();
	private List<Term> list; //返回学期
	private Course course;//封装课程对象
	private int termid;
	
	
	public String showtermandprofession(){
		list=courseService.showTerm();
		List<Profession> list2=new  ArrayList<Profession>();//返回一个专业集合
		list2=courseService.showProfession();
		requestMap.put("list2", list2);
		return "add";
	}
	
	
	public String showterm(){
		list=courseService.showTerm();
		return "showterm";
	}
	
	public String add(){
		courseService.save(course);
		return "addsuccess";
	}

	public String showcourse(){
	List<Course> lists=new ArrayList<Course>();
	lists=courseService.showcourse(termid);
	requestMap.put("lists", lists);
		return "showcourse";
	}
	public List<Term> getList() {
		return list;
	}


	public void setList(List<Term> list) {
		this.list = list;
	}

	public Course getCourse() {
		return course;
	}


	public void setCourse(Course course) {
		this.course = course;
	}


	public int getTermid() {
		return termid;
	}


	public void setTermid(int termid) {
		this.termid = termid;
	}
	

	
}
